//路由列表
import {createRouter,createWebHistory} from "vue-router";
import Login from "~/view/Login.vue";
import Index from "~/view/index/Index.vue"
import Userlist from "~/view/user/Userlist.vue"
import Demo from "~/view/demo/demo.vue"
import NotFound from '~/view/404/404.vue'
import Saleorder from '~/view/saleorder/index.vue'
export default createRouter({
    history:createWebHistory(),
    // routes:[{
    //     path:"URL地址",
    //     component:组件对象,
    //     name:"路由别名",
    // }]
    routes:[
            {
                path:"/",//组件的访问路径，必须已/开头
                component:Login,//不能加引号，直接填写对象即可
                name:"Login",
            },
            {
                path:"/index",//组件的访问路径，必须已/开头
                component:Index,//不能加引号，直接填写对象即可
                name:"Index",
                // redirect:"/Userlist",
                children:[
                    {
                        path:"/userlist",//组件的访问路径，必须已/开头
                        component:Userlist,//不能加引号，直接填写对象即可
                        name:"Userlist",
                    },
                ]
            },
            {
                path: '/:pathMatch(.*)*', 
                name: 'NotFound', 
                component: NotFound
            },
            {
                path:"/demo",//组件的访问路径，必须已/开头
                component:Demo,//不能加引号，直接填写对象即可
                name:"Demo",
            },
            {
                path:"/saleorder",//组件的访问路径，必须已/开头
                component:Saleorder,//不能加引号，直接填写对象即可
                name:"Saleorder",
            },
        ]
})